@import "../../common/style/mixin/template";

.c7n-iam-react-quill-editor {
  position: relative;

  .template();

  /* default header */
  .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  .ql-snow .ql-picker.ql-header .ql-picker-item::before {
    content: "标准";
  }

  /* default font */
  .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  .ql-snow .ql-picker.ql-font .ql-picker-item::before {
    content: "默认";
    content: "默认";
  }

  .ql-header,
  .ql-font,
  .ql-size {
    &.ql-picker {
      width: 0.68rem;
    }
  }

  .ql-open {
    width: 0.68rem !important;
    &::before {
      content: "展开更多";
    }
  }
  .ql-close {
    width: 0.68rem !important;
    &::before {
      content: "收起";
    }
  }

  .ql-fullscreen {
    width: 0.62rem !important;
    &::before {
      content: "全屏编辑";
    }
  }

  .ql-changeToHtml {
    margin-top: -3px;
  }

  /* font-size start */
  .ql-picker-size(@size) {
    &[data-value="#{@size}"]::before {
      content: @size;
      font-size: @size;
    }
  }

  .loop-picker(@i) when (@i <21) {
    .ql-snow .ql-picker.ql-size .ql-picker-label,
    .ql-snow .ql-picker.ql-size .ql-picker-item {
      .ql-picker-size(@i);
    }
    .loop-picker(@i+1);
  }
  .loop-picker(10);
  /* font-size end */

  /* link start */
  .ql-snow .ql-tooltip {
    &[data-mode="link"]::before {
      content: "输入链接:";
    }

    &::before {
      content: "访问链接:";
    }

    &.ql-editing a.ql-action::after {
      content: "保存";
    }

    & a {
      &.ql-action::after {
        content: "编辑";
      }

      &.ql-remove::before {
        content: "移除链接";
      }
    }
  }
  /* link end */

  .ql-snow .ql-picker.ql-font .ql-picker-label,
  .ql-snow .ql-picker.ql-font .ql-picker-item {
    &[data-value="STSong"]::before {
      content: "华文宋体";
      font-family: "STSong", sans-serif;
    }

    &[data-value="STKaiti"]::before {
      content: "华文楷体";
      font-family: "STKaiti", sans-serif;
    }

    &[data-value="STHeiti"]::before {
      content: "华文黑体";
      font-family: "STHeiti", sans-serif;
    }

    &[data-value="STFangsong"]::before {
      content: "华文仿宋";
      font-family: "STFangsong", sans-serif;
    }

    &[data-value="SimSun"]::before {
      content: "宋体";
      font-family: "SimSun", sans-serif;
    }

    &[data-value="SimHei"]::before {
      content: "黑体";
      font-family: "SimHei", sans-serif;
    }

    &[data-value="KaiTi"]::before {
      content: "楷体";
      font-family: "KaiTi", sans-serif;
    }

    &[data-value="FangSong"]::before {
      content: "仿宋";
      font-family: "FangSong", sans-serif;
    }

    &[data-value="Microsoft-YaHei"]::before {
      content: "微软雅黑";
      font-family: "Microsoft-YaHei", sans-serif;
    }

    .ql-font-STSong {
      font-family: "STSong", sans-serif;
    }

    .ql-font-STKaiti {
      font-family: "STKaiti", sans-serif;
    }

    .ql-font-STHeiti {
      font-family: "STHeiti", sans-serif;
    }

    .ql-font-STFangsong {
      font-family: "STFangsong", sans-serif;
    }

    .ql-font-SimSun {
      font-family: "SimSun", sans-serif;
    }

    .ql-font-KaiTi {
      font-family: "KaiTi", sans-serif;
    }

    .ql-font-SimHei {
      font-family: "SimHei", sans-serif;
    }

    .ql-font-FangSong {
      font-family: "FangSong", sans-serif;
    }

    .ql-font-Microsoft-YaHei {
      font-family: "Microsoft YaHei", sans-serif;
    }
  }

  .ql-editor {
    white-space: normal !important;
  }
}

.c7n-editor-changedHTML-container {
  position: absolute;
  top: 0;
  width: 100%;
  height: 320px;
  border: 1px solid #ccc;
  line-height: 1.42;
  outline: none;
  background: #fff;

  &-toolbar {
    border-bottom: 2px solid #ccc;
    height: 42px;
    box-sizing: border-box;
    font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    line-height: 42px;
    padding-left: 16px;
    background: #fff;

    span {
      cursor: pointer;
      font-weight: 500;
    }

    span:hover {
      color: #06c;
    }
  }

  .c7n-editor-changedHTML-container-content {
    width: 100%;
    height: 88%;
    padding: 12px 15px;
    outline: none;
    border: none;
    overflow-y: auto;
    -o-tab-size: 4;
    tab-size: 4;
    -moz-tab-size: 4;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    resize: none;
  }
}

.c7n-iam-editor-modal {
  width: 560px;
  height: 547px;

  &-preview-top {
    margin-top: 6px;

    &-btn {
      position: absolute;
      top: 68px;
      right: 8px;
      color: #3f51b5;
    }
  }

  &-preview-content {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 32px auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.08);
    z-index: 40;
  }

  &-preview-pic {
    position: absolute;
    width: 320px;
    height: 320px;
    top: 0;
    left: 0;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 41;
  }

  &-preview-sentence {
    font-size: 18px;
    color: rgba(0, 0, 0, 0.54);
  }
}

.c7n-iam-editor-dragger {
  display: block;
  width: 512px;
  height: 441px;
  text-align: center;

  .icon {
    width: 80px;
    height: 80px;
    font-size: 80px;
    color: #3f51b5;
  }

  &-text {
    font-size: 18px;
    line-height: 25px;
    margin-top: 40px;
  }

  &-hint {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 20px;
    margin-top: 16px;
  }

  &-preview-pic {
    position: absolute;
    width: 512px;
    height: 438px;
    top: 0;
    left: 0;
    background: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 41;
  }
}
